
class AssertionFailure < StandardError
end

def assert(*msg)
    raise AssertionFailure.new("Assertion failed! #{msg}") until yield if $DEBUG
end

def time_elapsed(name)
    puts "#{name} started"
    t1 = Time.now
    yield
    t2 = Time.now - t1
    puts "#{name} finished (#{(t2 * 100.0).round/100.0} sec)"
end